<fieldset>
{{#settings-row
	(t "settings.chat.provider.title")
	(t "settings.chat.provider.description")
	icon="fa-twitch"
	notes=(if (is-equal model.chat.provider "browser")
		(t "settings.chat.provider.notes-browser")
	)
}}
	{{#drop-down
		value=model.chat.provider
		content=contentChatProvider
		as |dropdown|
	}}
		{{#dropdown.selection as |selection|}}
			{{t (concat "settings.chat.provider.providers." selection.value ".label")}}
		{{/dropdown.selection}}
		{{#dropdown.list as |item|}}
			{{t (concat "settings.chat.provider.providers." item.value ".label")}}
		{{/dropdown.list}}
	{{/drop-down}}
{{/settings-row}}

{{#each-in providerAttributes as |name attributes|}}
	{{#each attributes as |attribute|}}
		{{#settings-row
			(t (concat "settings.chat.provider.providers." name ".attributes." attribute.name ".title"))
			(t (concat "settings.chat.provider.providers." name ".attributes." attribute.name ".description"))
			icon=attribute.options.icon
			substitutions=(if attribute.options.isArgs userArgsSubstitutions)
			isVisible=(is-equal model.chat.provider name)
		}}
			{{#if (is-equal attribute.type "string")}}
				{{#if attribute.options.isFile}}
					{{file-select
						value=(mut (get (get model.chat.providers name) attribute.name))
						inputClass="form-control"
						placeholder=(if (is-equal name "custom")
							(t "settings.chat.provider.file-placeholder")
							(get (get chatConfig name) attribute.name)
						)
					}}
				{{else if attribute.options.isUrl}}
					{{#radio-buttons
						value=(mut (get (get model.chat.providers name) attribute.name))
						content=contentChatUrl
						as |item|
					}}
						<div>
							{{item.button
								label=(t (concat "settings.chat.provider.url." item.value ".label"))
								description=(t (concat "settings.chat.provider.url." item.value ".description"))
							}}
						</div>
					{{/radio-buttons}}
				{{else}}
					{{input
						type="text"
						classNames="col-xs-12"
						value=(mut (get (get model.chat.providers name) attribute.name))
						placeholder=(if attribute.options.isArgs
							(t "settings.chat.provider.params-placeholder")
						)
					}}
				{{/if}}
			{{else if (is-equal attribute.type "boolean")}}
				{{check-box
					(t (concat "settings.chat.provider.providers." name ".attributes." attribute.name ".checkbox"))
					checked=(mut (get (get model.chat.providers name) attribute.name))
				}}
			{{/if}}
		{{/settings-row}}
	{{/each}}
{{/each-in}}
</fieldset>

<fieldset>
{{#settings-row
	(t "settings.chat.chat-open.title")
	(t "settings.chat.chat-open.description")
	icon="fa-comment"
}}
	<div>
		{{check-box
			(t "settings.chat.chat-open.checkbox")
			checked=model.streams.chat_open
		}}
	</div>
	<div>
		{{check-box
			(t "settings.chat.chat-open.checkbox-context")
			checked=model.streams.chat_open_context
			disabled=(bool-not model.streams.chat_open)
		}}
	</div>
{{/settings-row}}

{{#settings-row
	(t "settings.chat.twitchemotes.title")
	(t "settings.chat.twitchemotes.description")
	icon="fa-smile-o"
}}
	{{check-box
		(t "settings.chat.twitchemotes.checkbox")
		checked=model.streams.twitchemotes
	}}
{{/settings-row}}
</fieldset>